<template>
    <div>
        <h5>子组件</h5>
        父亲给的车 {{car}}
    </div>
</template>

<script setup lang="ts">
import { onMounted,defineEmits } from 'vue';
let emit = defineEmits(['getToy'])
defineProps(['car'])
onMounted(() => { 
    setTimeout(() => {
        emit('getToy', '奥特曼')
    }, 2000);
 })
</script>

<style scoped>

</style>